package com.original.simuladores.dao;

import java.io.Serializable;
import java.util.List;

public interface GenericDao<T> {
	/**
	 * create Object
	 * 
	 * @author ngochan
	 * @param Object
	 * @return primary key of record in database
	 */
	Serializable create(T instance);
	
	/**
	 * update Object
	 * 
	 * @author ngochan
	 * @param Object update
	 */
	Serializable update(T instance);

	/**
	 * Delete object
	 * 
	 * @author ngochan
	 * @param Object want to delete
	 */
    @SuppressWarnings("rawtypes")
    Serializable delete(Class instance, Serializable id);
    
    /**
     * Get Object by Id
     * @param T instance
     * @param id
     * @return Object
     */
    @SuppressWarnings("rawtypes")
	List<T> read(Class instance, Serializable id);
    
    /**
     * Get Object by Id
     * @param T instance
     * @param id
     * @return Object
     *//*
    @SuppressWarnings("rawtypes")
	List<T> read(Class instance, String id);*/
    
    /**
     * Get Object by Id
     * @param T instance
     * @param id
     * @return Object
     */
    @SuppressWarnings("rawtypes")
	List<T> read(Class instance);
    
    /**
     * Get lastest object
     * @param instance
     * @return List object
     */
    @SuppressWarnings("rawtypes")
    List<T> lastestObject(Class instance);

}
